/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.vaadin.demo.dashboard;

import com.vaadin.event.LayoutEvents;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
import com.vaadin.shared.ui.MarginInfo;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.*;

/**
 *
 * @author suyogn
 */
public class ConnectView extends VerticalLayout implements View, LayoutEvents.LayoutClickListener{
    
    
    private HorizontalLayout row ;
    
    @Override
    public void enter(ViewChangeEvent event) {
        setSizeFull();
        addStyleName("schedule");
        setMargin(false);
        setSizeFull();
    }
    
    
    public ConnectView()
    {
        
      /*  HorizontalLayout topDummy = new HorizontalLayout();
        topDummy.setWidth("100%");
        topDummy.setSpacing(true);
        topDummy.setMargin(true);
        topDummy.addStyleName("whiteBg");
        
        Label dummyWhiteLabel = new Label(GlobalConstants.emptyString);
        topDummy.addComponent(dummyWhiteLabel);
        topDummy.setComponentAlignment(dummyWhiteLabel, Alignment.MIDDLE_LEFT);
        topDummy.setExpandRatio(dummyWhiteLabel, 1);
        
        addComponent(topDummy);
        
        final Label title = new Label("Connect");
        title.setSizeUndefined();
        title.addStyleName("selectedMenuBanner");
        
        HorizontalLayout top = new HorizontalLayout();
        top.setWidth("100%");
        top.setSpacing(true);
        top.setMargin(true);
        top.addStyleName(GlobalConstants.toolbar_style);
        top.addStyleName("selectedMenuBanner");
        top.addStyleName("lightGrayFourSideBorder");
        
        addComponent(top);
        top.addComponent(title);
        top.setComponentAlignment(title, Alignment.MIDDLE_LEFT);
        top.setExpandRatio(title, 1);  */

      
        row = new HorizontalLayout();
        row.setHeight("100%");
        row.setWidth("100%");
        row.setMargin(new MarginInfo(true, true, false, true));
        row.setSpacing(true);
        
        Panel p = new Panel();
        p.setSizeFull();
        p.setContent(row);
        //p.addStyleName("fourSideWhiteBorder");
        
        addComponent(p);
        setExpandRatio(p, 1.5f);
        setComponentAlignment(p, Alignment.MIDDLE_CENTER);
        
        //Label about = new Label(GlobalConstants.getProperty(GlobalConstants.ABOUT), ContentMode.PREFORMATTED);
        Label about = new Label("<h3><b>Rahul Karad</b></h3>" +
"<b>Executive Director<b>, <br>"
                + "MAEER's MIT Group of Institutions, <br>"
                + "Chief Initiator & Dean, MIT School Of Government, <br>"
                + "Founder Convenor, Bharatiya Chhatra Sansad Foundation,<br>" +
"Paud Road, Kothrud,<br>" +
"PUNE – 411038 , Maharastra,India<br><br>" +

"Email:rahulvkarad@gmail.com", ContentMode.HTML);
        about.setWidth("50%");
        //about.addStyleName("formatText");
        
        VerticalLayout aboutLayout = new VerticalLayout();
        aboutLayout.setSizeFull();
        aboutLayout.addComponent(about);
        aboutLayout.setComponentAlignment(about, Alignment.MIDDLE_CENTER);
        
        row.addComponent(aboutLayout);
        //row.setExpandRatio(aboutLayout, 2.5f);
        row.setComponentAlignment(aboutLayout, Alignment.MIDDLE_CENTER);
        
        Label htmlSlider=new Label("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \n" +
"  \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n" +
"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n" +
" <head>\n" +
"  <title>jquery sliders</title>\n" +
"  <link rel=\"stylesheet\" href=\"slider/style.css\" type=\"text/css\" media=\"screen\" />\n" +

"  <script type=\"text/javascript\" src=\"slider/js/jquery.js\"></script>\n" +
"  <script type=\"text/javascript\" src=\"slider/js/scripts.js\"></script>\n" +
" </head>\n" +
" <body>\n" +
" \n" +
"  <!--/top-->\n" +
"  <div id=\"header\"><div class=\"wrap\">\n" +
"   <div id=\"slide-holder\">\n" +
"<div id=\"slide-runner\">\n" +
"    <a href=\"\"><img id=\"slide-img-1\" src=\"slider/images/nature-photo.png\" class=\"slide\" alt=\"\" /></a>\n" +
"    <a href=\"\"><img id=\"slide-img-2\" src=\"slider/images/nature-photo1.png\" class=\"slide\" alt=\"\" /></a>\n" +
"    <a href=\"\"><img id=\"slide-img-3\" src=\"slider/images/nature-photo2.png\" class=\"slide\" alt=\"\" /></a>\n" +
"    <a href=\"\"><img id=\"slide-img-4\" src=\"slider/images/nature-photo3.png\" class=\"slide\" alt=\"\" /></a>\n" +
"    <a href=\"\"><img id=\"slide-img-5\" src=\"slider/images/nature-photo4.png\" class=\"slide\" alt=\"\" /></a>\n" +
"    <a href=\"\"><img id=\"slide-img-6\" src=\"slider/images/nature-photo4.png\" class=\"slide\" alt=\"\" /></a>\n" +
"	<a href=\"\"><img id=\"slide-img-7\" src=\"slider/images/nature-photo6.png\" class=\"slide\" alt=\"\" /></a> \n" +
"    <div id=\"slide-controls\">\n" +
"     <p id=\"slide-client\" class=\"text\"><strong>post: </strong><span></span></p>\n" +
"     <p id=\"slide-desc\" class=\"text\"></p>\n" +
"     <p id=\"slide-nav\"></p>\n" +
"    </div>\n" +
"</div>\n" +
"	\n" +
"	<!--content featured gallery here -->\n" +
"   </div>\n" +
"   <script type=\"text/javascript\">\n" +
"    if(!window.slider) var slider={};slider.data=[{\"id\":\"slide-img-1\",\"client\":\"nature beauty\",\"desc\":\"nature beauty photography\"},{\"id\":\"slide-img-2\",\"client\":\"nature beauty\",\"desc\":\"add your description here\"},{\"id\":\"slide-img-3\",\"client\":\"nature beauty\",\"desc\":\"add your description here\"},{\"id\":\"slide-img-4\",\"client\":\"nature beauty\",\"desc\":\"add your description here\"},{\"id\":\"slide-img-5\",\"client\":\"nature beauty\",\"desc\":\"add your description here\"},{\"id\":\"slide-img-6\",\"client\":\"nature beauty\",\"desc\":\"add your description here\"},{\"id\":\"slide-img-7\",\"client\":\"nature beauty\",\"desc\":\"add your description here\"}];\n" +
"   </script>\n" +
"  </div></div><!--/header-->\n" +
" </body>\n" +
"</html>",ContentMode.HTML);
        
                String s = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" "
                + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> "
                + "<html xmlns=\"http://www.w3.org/1999/xhtml\" > "
                + "<head> "
                + "<title>Youtube link</title> "
                + "</head> "
                + "<body style=\"background: #d0ffd0;\"> "
                + "<div style='height: 5px;'> "
                + "<script src='http://demo.vaadin.com/xsembed/getEmbedJs' "
                + "type='text/javascript'></script> "
                + " </div> "
                + "<table align=\"center\" border=\"3\" width='100%' height='100%' > "
                + "<tr valign=\"top\"> "
                + "<td> "
                + "<iframe id=\"ytplayer\" type=\"text/html\" width=\"400\" height=\"300\"\n"
                + "src='"+"http://localhost:8084/safe-pro/VAADIN/themes/dashboard/slider/index.html"+"'\n"
                + "frameborder=\"0\" allowfullscreen>"
                + "</td> "
                + "</tr> "
                + "</table> "
                + "</body> "
                + "</html>";
                
           String sli = "<div id=\"slideshow-wrap\">\n"
                + "        <input type=\"radio\" id=\"button-1\" name=\"controls\" checked=\"checked\"/>\n"
                + "        <label for=\"button-1\"></label>\n" +
"        <input type=\"radio\" id=\"button-2\" name=\"controls\"/>\n" +
"        <label for=\"button-2\"></label>\n" +
"        <input type=\"radio\" id=\"button-3\" name=\"controls\"/>\n" +
"        <label for=\"button-3\"></label>\n" +
"        <input type=\"radio\" id=\"button-4\" name=\"controls\"/>\n" +
"        <label for=\"button-4\"></label>\n" +
"        <input type=\"radio\" id=\"button-5\" name=\"controls\"/>\n" +
"        <label for=\"button-5\"></label>\n" +
"        <label for=\"button-1\" class=\"arrows\" id=\"arrow-1\">></label>\n" +
"        <label for=\"button-2\" class=\"arrows\" id=\"arrow-2\">></label>\n" +
"        <label for=\"button-3\" class=\"arrows\" id=\"arrow-3\">></label>\n" +
"        <label for=\"button-4\" class=\"arrows\" id=\"arrow-4\">></label>\n" +
"        <label for=\"button-5\" class=\"arrows\" id=\"arrow-5\">></label>\n" +
"        <div id=\"slideshow-inner\">\n" +
"            <ul>\n" +
"                <li id=\"slide1\">\n" +
"                    <img src=\"http://cssdeck.com/uploads/media/items/3/3yiC6Yq.jpg\" />\n" +
"                    <div class=\"description\">\n" +
"                        <input type=\"checkbox\" id=\"show-description-1\"/>\n" +
"                        <label for=\"show-description-1\" class=\"show-description-label\">I</label>\n" +
"                        <div class=\"description-text\">\n" +
"                            <h2>Flower power</h2>\n" +
"                            <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut</p>\n" +
"                        </div>\n" +
"                    </div>\n" +
"                </li>\n" +
"                <li id=\"slide2\">\n" +
"                    <img src=\"http://cssdeck.com/uploads/media/items/4/40Ly3VB.jpg\" />\n" +
"                    <div class=\"description\">\n" +
"                        <input type=\"checkbox\" id=\"show-description-2\"/>\n" +
"                        <label for=\"show-description-2\" class=\"show-description-label\">I</label>\n" +
"                        <div class=\"description-text\">\n" +
"                            <h2>Golden sunset</h2>\n" +
"                            <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut</p>\n" +
"                        </div>\n" +
"                    </div>\n" +
"                </li>\n" +
"                <li id=\"slide3\">\n" +
"                    <img src=\"http://cssdeck.com/uploads/media/items/0/00kih8g.jpg\" />\n" +
"                    <div class=\"description\">\n" +
"                        <input type=\"checkbox\" id=\"show-description-3\"/>\n" +
"                        <label for=\"show-description-3\" class=\"show-description-label\">I</label>\n" +
"                        <div class=\"description-text\">\n" +
"                            <h2>Flower power again</h2>\n" +
"                            <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut</p>\n" +
"                        </div>\n" +
"                    </div>\n" +
"                </li>\n" +
"                <li id=\"slide4\">\n" +
"                    <img src=\"http://cssdeck.com/uploads/media/items/2/2rT2vdx.jpg\" />\n" +
"                    <div class=\"description\">\n" +
"                        <input type=\"checkbox\" id=\"show-description-4\"/>\n" +
"                        <label for=\"show-description-4\" class=\"show-description-label\">I</label>\n" +
"                        <div class=\"description-text\">\n" +
"                            <h2>Stormy coast</h2>\n" +
"                            <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut</p>\n" +
"                        </div>\n" +
"                    </div>\n" +
"                </li>\n" +
"                <li id=\"slide5\">\n" +
"                    <img src=\"http://cssdeck.com/uploads/media/items/8/8k3N3EL.jpg\" />\n" +
"                    <div class=\"description\">\n" +
"                        <input type=\"checkbox\" id=\"show-description-5\"/>\n" +
"                        <label for=\"show-description-5\" class=\"show-description-label\">I</label>\n" +
"                        <div class=\"description-text\">\n" +
"                            <h2>Splash!</h2>\n" +
"                            <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut</p>\n" +
"                        </div>\n" +
"                    </div>\n" +
"                </li>\n" +
"            </ul>\n" 
                   + "<script type=\"text/javascript\" defer=\"defer\">\n"
                
                
                + "document.getElementById('button-3').checked = true;"
                
                
                + "</script>" +
"        </div>\n" +
            
"    </div>";
        
     Label jSlider = new Label(sli, ContentMode.HTML);
     
        HorizontalLayout sliderLayout = new HorizontalLayout();
        sliderLayout.setSizeFull();
        sliderLayout.addComponent(jSlider);
        row.addComponent(sliderLayout);

    }

    private CssLayout createPanel(Component content) {
        CssLayout panel = new CssLayout();
        panel.setSizeFull();
        panel.addComponent(content);
        return panel;
    }

   

    @Override
    public void layoutClick(LayoutEvents.LayoutClickEvent event) 
    {
        Component c = event.getComponent();
        
    }
}
